package com.company.netease2020;

import java.util.Arrays;
import java.util.Scanner;

public class Test202003 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int q = sc.nextInt();
        int[] nums =  new int[n];
        for (int i = 0; i < n ; i++) {
            nums[i] = sc.nextInt();
        }
        int[] idx = new int[q];
        for (int i = 0; i < q; i++) {
            idx[i] = sc.nextInt();
        }

        // 排序
        Arrays.sort(nums);

        int[] count = new int[q];
        for (int i = 0; i < q; i++) {
            int temp = idx[i];
            int index = binarySearch(nums,temp);
            count[i] = n - index;
            for (int j = index; j < n ; j++) {
                nums[j] --;
            }
            System.out.println(count[i]);
        }


    }

    private static int binarySearch(int[] nums,int target){
        int l = 0,r = nums.length - 1;
        while (l < r){
            int mid = l + ((r - l) >> 1);
            if(nums[mid]> target){
                r = mid - 1;
            }else if(nums[mid] == target){
                r--;
            }else{
                l = mid + 1;
            }
        }
        return l;
    }
}
